jQuery(document).ready(function(){ 
    // set opacity to nill on page load
    jQuery("#mainmenu li span.navhover").css("opacity","0");
    jQuery("#mainmenu li span.navhover").css("display","block");
    // on mouse over    
    jQuery("#mainmenu li a").hover(function () {
        if(this.id !=p){
            // animate opacity to full
            jQuery(this).children(".navhover").stop().animate({
                opacity: 1
            }, "slow");
        }
    },
    // on mouse out   
    function () {
        if(this.id !=p){
            // animate opacity to nill
            jQuery(this).children(".navhover").stop().animate({
                opacity: 0
            }, "slow");
        }
    });
    jQuery("#mainmenu li #"+p+" span.navhover").css("opacity","100");
    jQuery("#contacts").live('click',function(){
        jQuery('#contacts-div').modal({
            opacity: 10,
            containerCss:{
                width: '614px',
                height: '256px',
                background: 'transparent',
                border: 0,
                padding: 0
            },
            onOpen: function (dialog) {
                dialog.data.hide();
                dialog.overlay.fadeIn('fast', function () {
                    dialog.container.fadeIn('fast', function () {
                        dialog.data.slideDown('normal',function(){
                            jQuery('.zmodalClose').fadeIn('fast');
                        });
                    });
                });
            },
            closeClass: 'zmodalClose'
        });
        jQuery('.zmodalClose').css({
            'margin-right':'19px',
            'margin-top':'25px',
            'display':'none'
        }); 
    })

    /*jQuery(".anketaAkcija").click( function() {
        if (jQuery("#ocidentifier").is(":hidden")) {
            jQuery("#anketa").animate({
                marginLeft: "-133px"
            }, 500 );
            jQuery("#ocidentifier").show();
        } else {
            jQuery("#anketa").animate({
                marginLeft: "0px"
            }, 500 );
            jQuery("#ocidentifier").hide();
        }
    });
    jQuery("#ocidentifier").hide(); */
});